namespace Screenshotz
{
    using System.Windows.Forms;

    public partial class InfoForm : Form
    {
        //[System.Runtime.InteropServices.DllImport("user32.dll")]
        //static extern bool ShowWindow(System.IntPtr hWnd, int nCmdShow);

        /// <summary>
        /// Initializes a new instance of the <see cref="InfoForm"/> class.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        public InfoForm(string fileName)
        {
            InitializeComponent();
            kryptonHeader1.Text = 
                "Screenshotz " + Nail.IOFile.ReadStringData(fileName, 1, ';');
            mLabel_ReleaseDate.Text =  
                "Version " + Nail.IOFile.ReadStringData(fileName, 1, ';') +
                "\n" + Nail.IOFile.ReadStringData(fileName, 2, ';');
        }

        private void ButtonOkClick(object sender, System.EventArgs e)
        {
            Close();            
        }

        private void InfoFormFormClosed(object sender, FormClosedEventArgs e)
        {
            //ShowWindow(this.Handle, (int)WindowShowStyle.Minimize);
            Dispose(true);            
        }

        private void LinkLabelEmailLinkClicked(object sender, System.EventArgs e)
        {
            using (System.Diagnostics.Process aMailApp = new System.Diagnostics.Process())
            {
                aMailApp.StartInfo.FileName = "mailto:" + mLinkLabel_Email.Text;
                aMailApp.StartInfo.UseShellExecute = true;
                aMailApp.StartInfo.RedirectStandardOutput = false;
                aMailApp.Start();
            }
        }

        private void LinkLabelWebsiteLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(mLinkLabel_Website.Text);
        }

        private void LinkLabelGoogleCodeLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(linkLabelGoogleCode.Text);
        }
    }
}